package com.piaohailin.feature.generic;

public class Search {

    public Search() {
    }

    public int search(int[] a, int target){
        for(int i = 0; i<a.length ; i++){
            if (a[i] == target)
                return i;
        }

        return -1;
    }

    public static void main(String[] args){
        int[] a = {1,3,5,6,7};
        Search search = new Search();
        System.out.println(search.search(a,1));
    }
}
